<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>订单页</title>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/order.css"/>
		<script src="./Public/Home/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="./Public/Home/js/area.js"></script>
	</head>
	<body>
		<!--网页头部、包含灰条、搜索区、导航栏-->
<header>
    <!--灰色条形区域-->
    <div id="top_bar">
        <div class="top_center">
            <!--灰条左侧-->
            <!--可以在这打印_SESSION看-->
                            <div class="fl top_site">
<!--                    <a href="javascript:;">收货地 &nbsp;&nbsp;</a>-->
                </div>
                <div class="fl top_site" >
                    欢迎<a target="_blank" style="color: red" href="p_1.html" id="yonghudenglu">李四</a>  !
                    &nbsp;&nbsp;|<a target="_blank" style="color: red" href="p_1.html">个人中心</a>&nbsp;&nbsp;&nbsp;|<a href="http://localhost/shop/index.php?m=Home&c=User&a=out">[退出]</a>
                </div>
                        <!--灰条右侧-->
            <div class="fr top_nav">
<!--                <a href="">我的订单</a>-->
            </div>
        </div>
    </div>
    <!--图片广告-->
    <a id="pic" target="_blank" href="d_53_35.html"></a>
    <!--头部栏区域-->
    <div id="head_bar">
        <div class="h_center">
            <!--logo-->
            <div class="fl headbar_logo">
                <a href="index.html"><img src="./Public/Home/img/icon11.png"/></a>
            </div>
            <div class="fl headbar_slogan">
                <a href="javascript:;" style="cursor: default"><img src="./Public/Home/img/icon13.png"></a>
            </div>
            <!--中部搜索-->
            <div class="fl headbar_search">
                <div class="search_box">
                    <form action="http://localhost/shop/index.php?m=Home&c=Price&a=index" method="post">
                        <input type="text" name="search" id="" class="fl search_input" value="" />
                        <input type="submit" class="fl search_btn" value="搜索"/>
                    </form>
                </div>
                <div class="search_words">
                    <span>热门搜索:</span>
                                        <a target="_blank" href="d_49_39.html" class="link">小米 小米手机5</a>
                                        <a target="_blank" href="d_44_23.html" class="link">苹果 iPad Air Wifi+Cellular</a>
                                        <a target="_blank" href="d_56_35.html" class="link">小米 红米手机 3S 标准版</a>
                                        <a target="_blank" href="d_59_35.html" class="link">魅族 魅蓝metal 公开版</a>
                                    </div>
            </div>
            <!--购物车-->
            <div class="fr buy_car_box">
                <div class="my_car">
                    <span class="silder"><b>0</b>
               </span>
                    <a href="cart.html">我的购物车</a>
                </div>
                                
<!--                <div class="car_empty">-->
<!--                    快去选择物品吧！-->
<!--                </div>-->
                                <p style="color: #999; text-align: center;">累计陪伴84万+用户</p>
            </div>
        </div>
    </div>
    <!--头部栏区域结束-->
    <!--导航条区域开始-->
    <div id="nav_bar">
        <div class="nav_center">
            <ul class="navbar_list">
                <li class="item all">
                    <a href="javascript:;" class="link" style="cursor: default">全部商品分类</a>
                    <ul class="nav_list">
                        <li class="bar">
                            <p class="nav_title type1">价格分类</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">价格选择</p>
                                    <ul class="nav_type">
                                        <li class="item"><a target="_blank" href="pr_1_499.html" class="link">1-499</a></li>
                                        <li class="item"><a target="_blank" href="pr_500_999.html" class="link">500-999</a></li>
                                        <li class="item"><a target="_blank" href="pr_1000_1999.html" class="link">1000-1999</a></li>
                                        <li class="item"><a target="_blank" href="pr_2000_2999.html" class="link">2000-2999</a></li>
                                        <li class="item"><a target="_blank" href="pr_3000_3999.html" class="link">3000-3999</a></li>
                                        <li class="item"><a target="_blank" href="pr_4000_4999.html" class="link">4000-4999</a></li>
                                        <li class="item"><a target="_blank" href="pr_5000_30000.html" class="link">5000以上</a></li>
                                    </ul>
                                    <a href="d_53_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua2.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                        <li class="bar">
                            <p class="nav_title type2">品牌分类</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">品牌选择</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="b_16.html" class="link">VIVO</a></li>
                                                                                <li class="item"><a target="_blank" href="b_13.html" class="link">酷派</a></li>
                                                                                <li class="item"><a target="_blank" href="b_18.html" class="link">暴风魔镜</a></li>
                                                                                <li class="item"><a target="_blank" href="b_12.html" class="link">苹果</a></li>
                                                                                <li class="item"><a target="_blank" href="b_6.html" class="link">华为</a></li>
                                                                                <li class="item"><a target="_blank" href="b_20.html" class="link">乐视</a></li>
                                                                                <li class="item"><a target="_blank" href="b_15.html" class="link">疾速</a></li>
                                                                                <li class="item"><a target="_blank" href="b_11.html" class="link">三星</a></li>
                                                                            </ul>
                                    <a href="d_54_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua7.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                        <li class="bar">
                            <p class="nav_title type6">热销商品</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">热销商品</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="d_49_39.html" class="link">小米 小米手机5</a></li>
                                                                                <li class="item"><a target="_blank" href="d_44_23.html" class="link">苹果 iPad Air Wifi+Cellular</a></li>
                                                                                <li class="item"><a target="_blank" href="d_56_35.html" class="link">小米 红米手机 3S 标准版</a></li>
                                                                                <li class="item"><a target="_blank" href="d_59_35.html" class="link">魅族 魅蓝metal 公开版</a></li>
                                                                                <li class="item"><a target="_blank" href="d_72_34.html" class="link">三星 存储卡8G class4</a></li>
                                                                                <li class="item"><a target="_blank" href="d_45_24.html" class="link">三星 GALAXY Tab S2 T810</a></li>
                                                                                <li class="item"><a target="_blank" href="d_50_5.html" class="link">小米 小米平板2</a></li>
                                                                                <li class="item"><a target="_blank" href="d_58_35.html" class="link">小米 小米Note 顶配版</a></li>
                                                                            </ul>
                                    <a href="d_55_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua3.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                                                <li class="bar">
                            <p class="nav_title type4">智能手机</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">智能手机</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="c_35.html" class="link">高性价比</a></li>
                                                                                <li class="item"><a target="_blank" href="c_36.html" class="link">拍照神器</a></li>
                                                                                <li class="item"><a target="_blank" href="c_37.html" class="link">高清大屏</a></li>
                                                                                <li class="item"><a target="_blank" href="c_38.html" class="link">主流商务</a></li>
                                                                                <li class="item"><a target="_blank" href="c_39.html" class="link">潮流热销</a></li>
                                                                                <li class="item"><a target="_blank" href="c_40.html" class="link">时尚外观</a></li>
                                                                                <li class="item"><a target="_blank" href="c_41.html" class="link">老人机</a></li>
                                                                            </ul>
                                    <a href="d_53_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua4.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                                                <li class="bar">
                            <p class="nav_title type5">智能设备</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">智能设备</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="c_19.html" class="link">智能手环</a></li>
                                                                                <li class="item"><a target="_blank" href="c_18.html" class="link">智能手表</a></li>
                                                                                <li class="item"><a target="_blank" href="c_22.html" class="link">智能机器人</a></li>
                                                                                <li class="item"><a target="_blank" href="c_21.html" class="link">智能家居</a></li>
                                                                                <li class="item"><a target="_blank" href="c_20.html" class="link">智能眼镜</a></li>
                                                                            </ul>
                                    <a href="d_54_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua5.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                                                <li class="bar">
                            <p class="nav_title type6">平板电脑</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">平板电脑</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="c_23.html" class="link">iPad Air</a></li>
                                                                                <li class="item"><a target="_blank" href="c_24.html" class="link">三星 GALAXY S2</a></li>
                                                                                <li class="item"><a target="_blank" href="c_25.html" class="link">iPad mini2</a></li>
                                                                                <li class="item"><a target="_blank" href="c_26.html" class="link">苹果 iPad mini 4</a></li>
                                                                                <li class="item"><a target="_blank" href="c_27.html" class="link">华为 荣耀X2</a></li>
                                                                                <li class="item"><a target="_blank" href="c_28.html" class="link">华为 M2</a></li>
                                                                                <li class="item"><a target="_blank" href="c_42.html" class="link">长虹V6</a></li>
                                                                            </ul>
                                    <a href="d_55_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua6.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                                                <li class="bar">
                            <p class="nav_title type7">手机配件</p>
                            <div class="nav_page">
                                <div class="nav_container">
                                    <p class="nav_name">手机配件</p>
                                    <ul class="nav_type">
                                                                                <li class="item"><a target="_blank" href="c_29.html" class="link">贴膜</a></li>
                                                                                <li class="item"><a target="_blank" href="c_30.html" class="link">移动电源</a></li>
                                                                                <li class="item"><a target="_blank" href="c_31.html" class="link">手机保护套</a></li>
                                                                                <li class="item"><a target="_blank" href="c_32.html" class="link">蓝牙耳机</a></li>
                                                                                <li class="item"><a target="_blank" href="c_33.html" class="link">充电器/数据线</a></li>
                                                                                <li class="item"><a target="_blank" href="c_34.html" class="link">存储卡</a></li>
                                                                            </ul>
                                    <a href="d_56_35.html" class="nav_img">
                                        <img src="./Public/Home/img/menua7.png" alt="" />
                                    </a>
                                </div>
                            </div>
                        </li>
                        
                    </ul>
                </li>
                                <li class="item"><a href="c_8.html" >智能手机</a></li>
                                <li class="item"><a href="c_6.html" >智能设备</a></li>
                                <li class="item"><a href="c_5.html" >平板电脑</a></li>
                                <li class="item"><a href="c_17.html" >手机配件</a></li>
                            </ul>
        </div>
    </div>
    <!--导航条区域结束-->
</header>


		<!--主要部分-->
		<div id="main">
			<div class="main_1200">
				<p class="buy_tips">填写并核对订单信息</p>
				<h2 class="send_way">配送方式</h2>
				<div class="wlps">
					<div class="wlps_box">
						<p class="title">物流配送</p>
						<p class="info">商品将由迪信通以快递的方式发送给您</p>
						<i class="icon"></i>
					</div>
				</div>
				<h2 class="get_address">收货地址</h2>
				<div class="address">
					<?php foreach ($addressData as $u){?>
					<div class="address_box" chooseRid="<?php echo $u['rid']?>" state="<?php echo $u['restate']?>">
						<p class="name"><?php echo $u['rename']?></p>
						<p class="tel"><?php echo $u['rephone']?></p>
						<p class="info"><?php echo $u['province']?> &nbsp; <?php echo $u['city']?> &nbsp; <?php echo $u['xian']?>  &nbsp;<?php echo $u['deaddress']?></p>
						<p class="operate">
							<a href="javascript:if(confirm('确定删除吗？'))  location.href='<?php echo U('delAddressp',array('rid'=>$u['rid']))?>';" class="btn del_ad">删除</a>
						</p>
						<i class="icon"></i>
					</div>
					<?php }?>
<!--					默认选中-->
					<script>
						window.onload=function(){
							$('.address_box').each(function(){
								if($(this).attr('state')==1){
									$(this).addClass('address_box1').siblings().removeClass('address_box1');
								}
							})
						}
					</script>
					<!--					点击选中地址-->
					<script>
						$(function(){
							$('.address_box').click(function() {
								$(this).addClass('address_box1').siblings().removeClass('address_box1');
								var rid=$(this).attr('chooseRid');
//									alert(rid);
								$.ajax({
									type:"post",
									url:"<?php echo U('Order/chooseAddress')?>",
									data:{r:rid},
								})
							})
						})
					</script>
					<div class="address_addbox">
						<p class="icon">+</p>
						<p class="name">新增收货地址</p>
					</div>
					<!--添加地址弹出框-->
					<script type="text/javascript">					
						$(function(){
							$(".address_addbox").click(function(){
								$("#zhezhao").fadeIn(200);
								$(".close").click(function(){
									$("#zhezhao").fadeOut(200);
								})
							});
						})
					</script>
				</div>
				<h2 class="goods_list">商品清单</h2>
				<div class="buy_listbox">
					<?php if(isset($buyData)){?>
                
					<div class="buy_item2">
						<div class="item2_top">
							<div class="item2_top1">
								<a href="<?php echo U('Detail/index',['coid'=>$buyData['id']])?>" class="good_img_box">
									<img src="<?php echo $buyData['commodimg']?>" alt="" />
								</a>																							
								<div class="goods_infobox1">
									<p class="goods_titletext"><?php echo $buyData['name']?></p>
									<p class="cgoods_info1">
										<?php foreach ($buyData['options'] as $v){?>
										<span><?php echo $v?></span>
										<?php }?>
									</p>
									<p class="cgoods_price">￥<span><?php echo $buyData['price']?></span></p>
								</div>
							</div>
							<div class="item2_top2">
								<p class="title">数量：</p>
								<p class="info"><span><?php echo $buyData['num']?></span>台</p>
							</div>
							<div class="item2_top3">
								<p class="address">发货地：<span>北京市</span></p> 
								<p class="true_buy">实付：￥<span><?php echo $buyData['price']*$buyData['num']?></span></p>
							</div>
						</div>
					</div>
					
               <?php }?>
				</div>
				<h2 class="remark_title">添加订单备注</h2>
				<textarea name="" rows="5" cols="" placeholder="限100个字" id="ordernote"></textarea>
				<div class="sub_info">
					<div class="left_mess">
						<p>发货时间：当天16：00前下单 18：00后发货，16：00后下单第二天上午发货</p>
						<p>温馨提示：因发货地不同，具体到货时间是发货地远近而定。 我们会在您提交订单后立即处理。</p>
						<p>到货时间：2-3天（新疆、西藏、港澳台等地区除外）</p>
					</div>
					<div class="right_mess">
						<p class="rows">共<span><?php echo $buyData['num']?></span>件商品，应付：<i>￥</i><span><?php echo $buyData['price']*$buyData['num']?></span></p>
						<p class="rows">运费：<i>￥</i><span>0.00</span></p>
						<p class="rows">已节省：	<i>￥</i><span><?php echo $buyData['sheng']?></span></p>
						<p class="rows">实付：<i>￥</i><span class="num" id="orderpri"><?php echo $buyData['price']*$buyData['num']?></span></p>
						<input type="submit" class="submit_btn" value="提交订单">
					</div>
					<script>
						$(function(){
							$('.submit_btn').click(function(){
								var orderpri=$('#orderpri').html();
								var ordernote=$('#ordernote').val();
								var shop_receipt_rid=$('.address_box1').attr('chooseRid');
								if(shop_receipt_rid){
								$.ajax({
									type:"post",
									url:"<?php echo U('orderdnow')?>",
									data:{orderpri:orderpri,ordernote:ordernote,shop_receipt_rid:shop_receipt_rid},
									success(){
//										alert(1);
										location.href=("<?php echo U('ordernowpay')?>");
									}
								})
								}else{
									alert("请先添加地址或者选择一个已有的地址哦");
								}
							})
						})
					</script>
				</div>
			</div>
		</div>
		<!--收货地址框开始-->
		<div id="zhezhao">
			<div class="address_form">
				<form action="<?php echo U('addAddressp')?>" method="post" id="addform">
					<h3 class="title">添加地址</h3>
					<div class="form_group">
						<label for="" class="label">
							<span class="must">*</span>
							所在区域：
						</label>
						<script type="text/javascript">
							$(function(){
								//初始化方法
								area.init('a');
								//修改的时候默认被选中效果
								// area.selected('黑龙江','哈尔滨','道里区');
							})
						</script>
						<div class="addselect">
							<select name="province" id="a1">

							</select>
							<select name="city" id="a2">

							</select>
							<select name="xian" id="a3">

							</select>
						</div>
					</div>
					<div class="form_group">
						<label for="" class="label">
							<span class="must">*</span>
							详细地址：
						</label>
						<input type="text" name="deaddress" id="" value="" />
					</div>
					<div class="form_group">
						<label for="" class="label">
							<span class="must">*</span>
							收货人：
						</label>
						<input type="text" name="rename" id="" value="" />
					</div>
					<div class="form_group">
						<label for="" class="label">
							<span class="must">*</span>
							手机号码：
						</label>
						<input type="text" name="rephone" id="" value="" />
					</div>
					<div class="form_group">
						<label for="" class="label">
							<span class="must"></span>
						</label>
					</div>
					<p class="save_btn"><input type="submit" value="保存地址"></p>
					<a href="javascript:;" class="close">X</a>
				</form>
			</div>
		</div>
		<!--收货地址框结束-->
		<!--底部区域-->
		<!--底部区域-->
		<footer>
			<div id="foot_box">
				<div class="foot_center">
					<dl class="friend">
						<dt>友情链接:</dt>
						<dd class="fl"><a href="http://www.mi.com/">小米</a></dd>
						<dd class="fl"><a href="http://www.meizu.com/">魅族</a></dd>
						<dd class="fl"><a href="http://www.huawei.com/cn/">华为</a></dd>
						<dd class="fl"><a href="http://www.360shouji.com/home/">360</a></dd>
					</dl>
					<p>联系开发者：15830097257</p>
					<p>站长邮箱: 413551717@qq.com</p>
					<p class="record">Powered by Y-Jinlong©2001-2017京ICP备号15830097257©2001-2017 Y-Jinlong Inc. </p>
				</div>
			</div>
		</footer>
		<!--底部区域-->
		<!--底部区域-->
	</body>
</html>
